#!/usr/bin/env bash
# build.sh
# script to build psh for various platforms
# By J. Stuart McMurray
# Created 20131123
# Last Modified 20131123

set -e

ARCHES="386 amd64"
OSES="linux freebsd netbsd openbsd darwin windows"

# Build all OS/arch combinations
for GOARCH in $ARCHES; do
        for GOOS in $OSES; do
                BNAME=psh-$GOOS-$GOARCH
                GOOS=$GOOS GOARCH=$GOARCH go build -v -o psh-$GOOS-$GOARCH psh.go
                echo $BNAME
        done
done

# Give windows versions .exes.
for i in psh-windows-*; do
        mv $i $i.exe
done
